package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-04-06.
 */
@Entity
@Table(name = "seller", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class SellerEntity extends IAcross
{
    private static final long serialVersionUID = -8471912362612237265L;
    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
    private int sellerId;
    private String sellerCode;
    private String name;
    private String phone;
    private String mobile;
    private String email;
    private String qq;
    private String address;
    private String contacts;
    private String type;
    private String level;
    private String status;
    private Timestamp createDate;
    private int createId;
    private Timestamp expireDate;
    private Timestamp closeDate;
    private Integer closeId;
    private Integer hc;
    private BigDecimal imprestLimit;
    private Integer serviceCharge;
    private String servicestyle;
    private String sellscope;
    private String mFilepath;
    private byte[] picbytes;
    private String sellerType;
    private BusAuditLogEntity auditLogEntity;

	public SellerEntity()
	{
		super();
	}
	public SellerEntity(IAcross ia)
	{
		super(ia);
	}


    public SellerEntity(int sellerId, String bus_name,String bus_address,String servicestyle,String sellerscope,String filename,byte[] picbytes,String status,String sellerType)
    {
        this();
        this.sellerId=sellerId;
        this.name=bus_name;
        this.address=bus_address;
        this.servicestyle=servicestyle;
        this.sellscope=sellerscope;
        this.mFilepath=filename;
        this.picbytes=picbytes;
        this.status=status;
        this.sellerType=sellerType;
    }

    @Id
    @Column(name = "seller_id")
    @GeneratedValue
    public int getSellerId() {
        return sellerId;
    }

    public void setSellerId(int sellerId) {
        this.sellerId = sellerId;
    }

    @Basic
    @Column(name = "seller_code", length = 20)
    public String getSellerCode() {
        return sellerCode;
    }

    public void setSellerCode(String sellerCode) {
        this.sellerCode = sellerCode;
    }

    @Basic
    @Column(name = "name", length = 40)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "phone", nullable = true,  updatable = true, length = 20)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "mobile", nullable = true,  updatable = true, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "email", nullable = true,  updatable = true, length = 40)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "QQ", nullable = true,  updatable = true, length = 20)
    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    @Basic
    @Column(name = "address", nullable = true,  updatable = true, length = 200)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "contacts", length = 20)
    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    @Basic
    @Column(name = "type", length = 10)
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "level", length = 10)
    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    @Basic
    @Column(name = "status", length = 10)
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_date", nullable = true,  updatable = true)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "create_id")
    public int getCreateId() {
        return createId;
    }

    public void setCreateId(int createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "expire_date", nullable = true,  updatable = true)
    public Timestamp getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(Timestamp expireDate) {
        this.expireDate = expireDate;
    }

    @Basic
    @Column(name = "close_date", nullable = true,  updatable = true)
    public Timestamp getCloseDate() {
        return closeDate;
    }

    public void setCloseDate(Timestamp closeDate) {
        this.closeDate = closeDate;
    }

    @Basic
    @Column(name = "close_id", nullable = true,  updatable = true)
    public Integer getCloseId() {
        return closeId;
    }

    public void setCloseId(Integer closeId) {
        this.closeId = closeId;
    }

    @Basic
    @Column(name = "hc", nullable = true,  updatable = true)
    public Integer getHc() {
        return hc;
    }

    public void setHc(Integer hc) {
        this.hc = hc;
    }

    @Basic
    @Column(name = "imprest_limit", nullable = true,  updatable = true, precision = 2)
    public BigDecimal getImprestLimit() {
        return imprestLimit;
    }

    public void setImprestLimit(BigDecimal imprestLimit) {
        this.imprestLimit = imprestLimit;
    }

    @Basic
    @Column(name = "service_charge", nullable = true,  updatable = true)
    public Integer getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(Integer serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SellerEntity that = (SellerEntity) o;

        if (createId != that.createId) return false;
        if (sellerId != that.sellerId) return false;
        if (address != null ? !address.equals(that.address) : that.address != null) return false;
        if (closeDate != null ? !closeDate.equals(that.closeDate) : that.closeDate != null) return false;
        if (closeId != null ? !closeId.equals(that.closeId) : that.closeId != null) return false;
        if (contacts != null ? !contacts.equals(that.contacts) : that.contacts != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        if (expireDate != null ? !expireDate.equals(that.expireDate) : that.expireDate != null) return false;
        if (hc != null ? !hc.equals(that.hc) : that.hc != null) return false;
        if (imprestLimit != null ? !imprestLimit.equals(that.imprestLimit) : that.imprestLimit != null) return false;
        if (level != null ? !level.equals(that.level) : that.level != null) return false;
        if (mobile != null ? !mobile.equals(that.mobile) : that.mobile != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (phone != null ? !phone.equals(that.phone) : that.phone != null) return false;
        if (qq != null ? !qq.equals(that.qq) : that.qq != null) return false;
        if (sellerCode != null ? !sellerCode.equals(that.sellerCode) : that.sellerCode != null) return false;
        if (serviceCharge != null ? !serviceCharge.equals(that.serviceCharge) : that.serviceCharge != null)
            return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sellerId;
        result = 31 * result + (sellerCode != null ? sellerCode.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (phone != null ? phone.hashCode() : 0);
        result = 31 * result + (mobile != null ? mobile.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (qq != null ? qq.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (contacts != null ? contacts.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (level != null ? level.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + createId;
        result = 31 * result + (expireDate != null ? expireDate.hashCode() : 0);
        result = 31 * result + (closeDate != null ? closeDate.hashCode() : 0);
        result = 31 * result + (closeId != null ? closeId.hashCode() : 0);
        result = 31 * result + (hc != null ? hc.hashCode() : 0);
        result = 31 * result + (imprestLimit != null ? imprestLimit.hashCode() : 0);
        result = 31 * result + (serviceCharge != null ? serviceCharge.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "servicestyle", nullable = true,  updatable = true, length = 200)
    public String getServicestyle() {
        return servicestyle;
    }

    public void setServicestyle(String servicestyle) {
        this.servicestyle = servicestyle;
    }

    @Basic
    @Column(name = "sellscope", nullable = true,  updatable = true, length = 200)
    public String getSellscope() {
        return sellscope;
    }

    public void setSellscope(String sellscope) {
        this.sellscope = sellscope;
    }

    @Basic
    @Column(name = "m_filepath", nullable = true,  updatable = true, length = 200)
    public String getmFilepath() {
        return mFilepath;
    }

    public void setmFilepath(String mFilepath) {
        this.mFilepath = mFilepath;
    }

    @Basic
    @Column(name = "seller_type", nullable = true,  updatable = true, length = 100)
    public String getSellerType() {
        return sellerType;
    }

    public void setSellerType(String sellerType) {
        this.sellerType = sellerType;
    }

    @Transient
    public byte[] getPicByte() {
        return picbytes;
    }

    public void setPicByte(byte[] picbytes) {
        this.picbytes = picbytes;
    }

    @Transient
    public BusAuditLogEntity getAuditLogEntity() {
        return auditLogEntity;
    }

    public void setAuditLogEntity(BusAuditLogEntity auditLogEntity) {
        this.auditLogEntity = auditLogEntity;
    }
}
